#include "head.h"
/* Usage: */

client_status* login(int net_fd){
    client_status *user = (client_status*)calloc(1, sizeof(client_status));
    recv(net_fd, user, sizeof(client_status), 0);
    char name[1000];
    
    user->user_name[strlen(user->user_name)-1] = 0;
    strcpy(name, user->user_name);
    DIR *d = opendir(name);
    if(!d){
        
        int res_mkdir = mkdir(name, 0777);
        //chmod(name, 0666);
        d = opendir(name);
    }
    //user.user_name = name;
    //strcpy(user.root_path, root);
    strcpy(user->path, "");
    return user;
}

bool unlogin(client_status *user, int net_fd){
    
}
